package com.feng.gulimall.cart.service;

import com.feng.gulimall.cart.vo.CartItemVo;
import com.feng.gulimall.cart.vo.CartVo;

import java.util.concurrent.ExecutionException;

public interface CartService {
    //购物车添加
    CartItemVo addToCart(Long skuId, Integer num) throws ExecutionException, InterruptedException;

    CartItemVo getCartItem(Long skuId);

    CartVo getCart() throws ExecutionException, InterruptedException;

    /**
     * 清空购物车数据
     * @param key
     */
    public void clearCart(String key);

    /**
     * 勾选购物项
     * @param skuId
     * @param check
     */
    void checkItem(Long skuId, Integer check);

    /**
     *
     * @param skuId
     * @param num
     */
    void changItemCount(Long skuId, Integer num);

    /**
     * 删除购物车
     * @param skuId
     */
    void deletCart(Long skuId);
}
